<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>LTE-UNB: PhysicalLayer/Subcarrier.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">LTE-UNB
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">PhysicalLayer/Subcarrier.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_subcarrier_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef _Subcarrier_h_</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define _Subcarrier_h_</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;itpp/itbase.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;<a class="code" href="_resource_element_8h.html">ResourceElement.h</a>&quot;</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="keyword">using namespace </span>itpp;
<a name="l00025"></a>00025 <span class="keyword">using namespace </span>std;
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keyword">namespace </span>PhysicalLayer
<a name="l00028"></a>00028 {
<a name="l00029"></a>00029 
<a name="l00034"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html">00034</a> <span class="keyword">class </span><a class="code" href="class_physical_layer_1_1_subcarrier.html">Subcarrier</a>
<a name="l00035"></a>00035 {
<a name="l00036"></a>00036    <span class="keyword">public</span>:
<a name="l00037"></a>00037 
<a name="l00042"></a>00042       <a class="code" href="class_physical_layer_1_1_subcarrier.html">Subcarrier</a>( <span class="keywordtype">double</span> frequency );
<a name="l00043"></a>00043       
<a name="l00048"></a>00048       <span class="keyword">virtual</span> ~<a class="code" href="class_physical_layer_1_1_subcarrier.html">Subcarrier</a>();
<a name="l00049"></a>00049 
<a name="l00054"></a>00054       <span class="keywordtype">void</span> setParameters();
<a name="l00055"></a>00055       
<a name="l00060"></a>00060       <span class="keywordtype">void</span> initialize( <span class="keywordtype">double</span> frequency );
<a name="l00061"></a>00061       
<a name="l00066"></a>00066       <span class="keywordtype">int</span> getRawBits();
<a name="l00067"></a>00067       
<a name="l00072"></a>00072       <span class="keywordtype">double</span> getEffectiveBits();
<a name="l00073"></a>00073       
<a name="l00078"></a>00078       <span class="keywordtype">double</span> getFrequency();
<a name="l00079"></a>00079       
<a name="l00084"></a>00084       <span class="keywordtype">int</span> getNumberREs();
<a name="l00085"></a>00085       
<a name="l00090"></a>00090       <a class="code" href="class_physical_layer_1_1_resource_element.html">ResourceElement</a>* getRE( <span class="keywordtype">int</span> index );
<a name="l00091"></a>00091 
<a name="l00092"></a>00092              
<a name="l00093"></a>00093    <span class="keyword">protected</span>:
<a name="l00094"></a>00094       
<a name="l00099"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#aa4d93f4b3ac45dd98867fcdc10967997">00099</a>       <span class="keywordtype">int</span> <a class="code" href="class_physical_layer_1_1_subcarrier.html#aa4d93f4b3ac45dd98867fcdc10967997">numberResourceElements_</a>;
<a name="l00100"></a>00100       
<a name="l00105"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#a8755ea0d81a97522b575c74f2a25a941">00105</a>       Array&lt;ResourceElement*&gt; <a class="code" href="class_physical_layer_1_1_subcarrier.html#a8755ea0d81a97522b575c74f2a25a941">resourceElements_</a>;
<a name="l00106"></a>00106       
<a name="l00111"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#ad626f998e406adbb6e3a348084883dfe">00111</a>       <span class="keywordtype">double</span> <a class="code" href="class_physical_layer_1_1_subcarrier.html#ad626f998e406adbb6e3a348084883dfe">frequency_</a>;
<a name="l00112"></a>00112    
<a name="l00117"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#ab5cacd000b684c0f74eb99ceccc05e69">00117</a>      <span class="keywordtype">int</span> <a class="code" href="class_physical_layer_1_1_subcarrier.html#ab5cacd000b684c0f74eb99ceccc05e69">SoundingSlots_</a>;
<a name="l00122"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#afacddeede59d45c7c64a611824190226">00122</a>      <span class="keywordtype">int</span> <a class="code" href="class_physical_layer_1_1_subcarrier.html#afacddeede59d45c7c64a611824190226">Direction_</a>;
<a name="l00123"></a>00123      
<a name="l00124"></a>00124      
<a name="l00125"></a>00125    <span class="keyword">private</span>:
<a name="l00126"></a>00126    
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 };
<a name="l00129"></a>00129 
<a name="l00130"></a>00130 };
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 <span class="keyword">inline</span>
<a name="l00133"></a>00133 <span class="keywordtype">int</span>
<a name="l00134"></a>00134 <a class="code" href="class_physical_layer_1_1_subcarrier.html#a877a940bb033e50c443870c5a346e1f1">PhysicalLayer::</a>
<a name="l00135"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#a877a940bb033e50c443870c5a346e1f1">00135</a> <a class="code" href="class_physical_layer_1_1_subcarrier.html#a877a940bb033e50c443870c5a346e1f1">Subcarrier::getRawBits</a>()
<a name="l00136"></a>00136 {
<a name="l00137"></a>00137    <span class="keywordtype">int</span> r = 0;
<a name="l00138"></a>00138    <span class="keywordtype">int</span> size = resourceElements_.size();
<a name="l00139"></a>00139    
<a name="l00140"></a>00140    <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i = 0; i &lt; size; ++i )
<a name="l00141"></a>00141    {
<a name="l00142"></a>00142       r += resourceElements_(i)-&gt;getRawBits(); 
<a name="l00143"></a>00143    }
<a name="l00144"></a>00144    
<a name="l00145"></a>00145    <span class="keywordflow">return</span> r;
<a name="l00146"></a>00146 };
<a name="l00147"></a>00147 
<a name="l00148"></a>00148 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 <span class="keyword">inline</span>
<a name="l00151"></a>00151 <span class="keywordtype">double</span>
<a name="l00152"></a>00152 <a class="code" href="class_physical_layer_1_1_subcarrier.html#a3281af52749323f09af1ec4148e139be">PhysicalLayer::</a>
<a name="l00153"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#a3281af52749323f09af1ec4148e139be">00153</a> <a class="code" href="class_physical_layer_1_1_subcarrier.html#a3281af52749323f09af1ec4148e139be">Subcarrier::getEffectiveBits</a>()
<a name="l00154"></a>00154 {
<a name="l00155"></a>00155    <span class="keywordtype">double</span> e = 0.0;
<a name="l00156"></a>00156    <span class="keywordtype">int</span> size = resourceElements_.size();
<a name="l00157"></a>00157    
<a name="l00158"></a>00158    <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i = 0; i &lt; size; ++i )
<a name="l00159"></a>00159    {
<a name="l00160"></a>00160       e += resourceElements_(i)-&gt;getEffectiveBits(); 
<a name="l00161"></a>00161    }
<a name="l00162"></a>00162    
<a name="l00163"></a>00163    <span class="keywordflow">return</span> e;
<a name="l00164"></a>00164 };
<a name="l00165"></a>00165 
<a name="l00166"></a>00166 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00167"></a>00167 
<a name="l00168"></a>00168 <span class="keyword">inline</span>
<a name="l00169"></a>00169 <span class="keywordtype">double</span>
<a name="l00170"></a>00170 <a class="code" href="class_physical_layer_1_1_subcarrier.html#a805c6d0ab541245b2f3a73b1c523fc0c">PhysicalLayer::</a>
<a name="l00171"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#a805c6d0ab541245b2f3a73b1c523fc0c">00171</a> <a class="code" href="class_physical_layer_1_1_subcarrier.html#a805c6d0ab541245b2f3a73b1c523fc0c">Subcarrier::getFrequency</a>()
<a name="l00172"></a>00172 {
<a name="l00173"></a>00173    <span class="keywordflow">return</span> frequency_;
<a name="l00174"></a>00174 };
<a name="l00175"></a>00175 
<a name="l00176"></a>00176 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00177"></a>00177 
<a name="l00178"></a>00178 <span class="keyword">inline</span>
<a name="l00179"></a>00179 <span class="keywordtype">int</span>
<a name="l00180"></a>00180 <a class="code" href="class_physical_layer_1_1_subcarrier.html#a0352a342b0a6ffc6e9a90ab86ac77d6d">PhysicalLayer::</a>
<a name="l00181"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#a0352a342b0a6ffc6e9a90ab86ac77d6d">00181</a> <a class="code" href="class_physical_layer_1_1_subcarrier.html#a0352a342b0a6ffc6e9a90ab86ac77d6d">Subcarrier::getNumberREs</a>()
<a name="l00182"></a>00182 {
<a name="l00183"></a>00183    <span class="keywordflow">return</span> resourceElements_.size();
<a name="l00184"></a>00184 };
<a name="l00185"></a>00185 
<a name="l00186"></a>00186 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00187"></a>00187 
<a name="l00188"></a>00188 
<a name="l00189"></a>00189 <span class="keyword">inline</span>
<a name="l00190"></a>00190 <a class="code" href="class_physical_layer_1_1_resource_element.html">PhysicalLayer::ResourceElement</a>*
<a name="l00191"></a>00191 <a class="code" href="class_physical_layer_1_1_subcarrier.html#a0e5e47afa27c73e41546e615a8f68005">PhysicalLayer::</a>
<a name="l00192"></a><a class="code" href="class_physical_layer_1_1_subcarrier.html#a0e5e47afa27c73e41546e615a8f68005">00192</a> <a class="code" href="class_physical_layer_1_1_subcarrier.html#a0e5e47afa27c73e41546e615a8f68005">Subcarrier::getRE</a>( <span class="keywordtype">int</span> index )
<a name="l00193"></a>00193 {
<a name="l00194"></a>00194    <a class="code" href="class_physical_layer_1_1_resource_element.html">ResourceElement</a>* re = 0;
<a name="l00195"></a>00195    <span class="keywordflow">if</span> ( index &lt; resourceElements_.size() )
<a name="l00196"></a>00196    {
<a name="l00197"></a>00197       re = resourceElements_( index );
<a name="l00198"></a>00198    }
<a name="l00199"></a>00199    <span class="keywordflow">else</span>
<a name="l00200"></a>00200    {
<a name="l00201"></a>00201       it_error( <span class="stringliteral">&quot;Subcarrier: Index out of range&quot;</span> );
<a name="l00202"></a>00202    }  
<a name="l00203"></a>00203    
<a name="l00204"></a>00204    <span class="keywordflow">return</span> re;
<a name="l00205"></a>00205 };
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 <span class="comment">// -----------------------------------------------------------------------------</span>
<a name="l00208"></a>00208 
<a name="l00209"></a>00209 <span class="preprocessor">#endif</span>
<a name="l00210"></a>00210 <span class="preprocessor"></span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 25 2012 22:25:34 for LTE-UNB by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
